<template>
  <!--充值成功放回界面-->
  <div id="login">
    <div class="returnDiv">
      <el-result icon="success" title="提示" subTitle="短信充值成功">
        <template slot="extra">
          <el-button @click="goHome">放回首页</el-button>
        </template>
      </el-result>
    </div>
  </div>
</template>

<script>
import {Dialog,Result} from 'element-ui';
export default {
  name: "returnUrl",
  components:{
    Dialog,Result
  },
  methods: {
    //放回首页
    goHome() {
      this.$router.push("/");
    },
    //回掉支付宝
    recall() {
      let recallData = this.$qs.stringify(this.$route.query)
      this.$axios({
        url: "/noteOrder/residueReBack",
        method: "POST",
        data: recallData
      }).then(response => {
        console.log(response.data);
        this.$store.commit("setUserContext", response.data.noteClass);
        // Dialog.alert({
        //   messageAlign: 'left',
        //   transition: 'van-fade',
        //   title: '支付成功',
        //   message: '购买商品:'+response.data.responseData.commodityName+'\n' +
        //       '支付金额:'+response.data.responseData.payMoney+"元\n"+
        //       '创建时间:'+response.data.responseData.finishTime,
        //   theme: 'round-button',
        // }).then(() => {
        //   // on close
        // });
      }).catch(error => {
        console.log(error);
      })


    },
  },
  mounted() {
    this.recall();
  }
}
</script>

<style scoped>
#login {
  width: 100%;
  height: 100%;
  background: url("../../assets/background.png");
}
.returnDiv{
  position:absolute;
  left:50%;
  top:50%;
  width: 300px;
  height: 300px;
  border-radius: 10px;
  transform: translate(-50%, -50%);
}
</style>
